<template>
	<div class="search-parent">
		<div class="back-activity">
			<a v-link="{path: '/'}" class="btn btn-sm btn-primary">返回活动</a>
			<button class="btn btn-sm btn-primary" @click = "courseManage">课程发奖管理</button>
		</div>
		<form class="form-inline text-right search-result" @submit.prevent="getList">
	    <div class="form-group form-group-sm">
	      <select class="form-control" v-model="searchType">
	        <option value="1">奖品名称</option>
	        <option value="2">奖品类型</option>
	        <option value="3">手机号码</option>
	      </select>
	      <input type="text" class="form-control" v-model="searchTxt" placeholder="" v-if="+searchType !== 2">
	      <select class="form-control" v-model="typePrize" v-if="+searchType === 2">
	        <option value="0">实物奖品</option>
	        <option value="1">虚拟奖品</option>
	        <option value="2">需兑换码奖品</option>
	        <option value="3">贝塔豆</option>
	        <option value="4">课程</option>
	      </select>
	      <input type="submit" class="btn btn-sm btn-primary" value="搜索">
	    </div>
	  </form>
	</div>
	<div class="result-parent">
		<span class="result">{{activityName}}的中奖结果</span>
		<span class="total">中奖个数为<b>{{totalCount}}</b></span>
	</div>

	<table class="table table-bordered table-hover">
		<!-- <caption>{{activityName}}的中奖结果</caption> -->
		<thead>
			<tr>
				<th class="col-sm-2">奖品名称</th>
				<th class="col-sm-2">中奖号码</th>
				<th class="col-sm-4">奖品图片</th>
				<th class="col-sm-2">奖品类型</th>
				<th class="col-sm-2">奖品兑换码</th>
			</tr>
		</thead>
		<tbody>
			<tr v-for="prizeResult in prizeRList">
				<td>{{prizeResult.name}}</td>
				<td>{{prizeResult.phone}}</td>
				<td><img :src="prizeResult.pic" class="prize-result-img"></td>
				<td>{{ prizeResult.type | CustomType}}</td>
				<td>{{prizeResult.code}}</td>
			</tr>
		</tbody>
	</table>
	<vue-pages :pages.sync="pages" :get-list="getList"></vue-pages>
</template>
<style src="./result-list.css" scoped></style>
<script src="./result-list.js"></script>
